<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/index.xhtml">
        <ui:define name="title"/>
        <ui:define name="body">

            <h:form>
                <p:panel id="panel" header="#{bundle.CreateTblInsumoActividadTitle}" style="margin-bottom:5px;">

                    <h:panelGroup id="messagePanel" layout="block">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                    </h:panelGroup>

                    <h:panelGrid columns="3" cellpadding="3">

                        <p:outputLabel value="#{bundle.CreateTblInsumoActividadLabel_tblActividad}" for="tblActividad" />
                        <p:selectOneMenu id="tblActividad" value="#{tblInsumoActividadController.selected.tblActividad}" required="true" requiredMessage="#{bundle.CreateTblInsumoActividadRequiredMessage_tblActividad}">
                            <h:selectOneMenu title="#{bundle.CreateTblInsumoActividadTitle_tblActividad}"/>
                            <f:selectItems value="#{tblActividadController.itemsAvailableSelectOne}"/>
                            <f:validateLength minimum="2" />
                        </p:selectOneMenu>
                        <p:message for="tblActividad" />

                        <p:outputLabel value="#{bundle.CreateTblInsumoActividadLabel_tblInsumos}" for="tblInsumos" />
                        <p:selectOneMenu id="tblInsumos" value="#{tblInsumoActividadController.selected.tblInsumos}" required="true" requiredMessage="#{bundle.CreateTblInsumoActividadRequiredMessage_tblInsumos}">
                            <h:selectOneMenu title="#{bundle.CreateTblInsumoActividadTitle_tblInsumos}"/>
                            <f:selectItems value="#{tblInsumosController.itemsAvailableSelectOne}"/>
                            <f:validateLength minimum="2" />
                        </p:selectOneMenu>
                        <p:message for="tblInsumos" />

                        <p:outputLabel value="#{bundle.CreateTblInsumoActividadLabel_cantidad}" for="cantidad" />
                        <p:inputText id="cantidad" value="#{tblInsumoActividadController.selected.cantidad}" title="#{bundle.CreateTblInsumoActividadTitle_cantidad}" required="true" requiredMessage="#{bundle.CreateTblInsumoActividadRequiredMessage_cantidad}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="cantidad" />

                        <p:outputLabel value="#{bundle.CreateTblInsumoActividadLabel_valor}" for="valor" />
                        <p:inputText id="valor" value="#{tblInsumoActividadController.selected.valor}" title="#{bundle.CreateTblInsumoActividadTitle_valor}" required="true" requiredMessage="#{bundle.CreateTblInsumoActividadRequiredMessage_valor}">
                            <f:validateLength minimum="2" />
                        </p:inputText>
                        <p:message for="valor" />

                        <p:outputLabel value="#{bundle.CreateTblInsumoActividadLabel_total}" for="total" />
                        <p:inputText id="total" value="#{tblInsumoActividadController.selected.total}" title="#{bundle.CreateTblInsumoActividadTitle_total}"/>
                        <p:separator/>
                        
                    </h:panelGrid>
                    <br />
                    <p:commandButton action="#{tblInsumoActividadController.create}" value="#{bundle.CreateTblInsumoActividadSaveLink}" update="panel"/>
                    <p:commandButton action="#{tblInsumoActividadController.prepareList}" value="#{bundle.CreateTblInsumoActividadShowAllLink}" immediate="true"/>

                </p:panel> 
            </h:form>
        </ui:define>
    </ui:composition>

</html>
